import $http from '../../../servers/http';
import { Result } from 'seats/schema/Result';

const BASE_URL = '/weathersms/web/industry/datastatistics';

/**行短权限*/
export const smsAuth = (): Promise<Result<any>> => {
  return $http.get({
    url: `/weathersms/sys/user/hangduan`,
  });
};

/**行短发送量统计*/
export const homeIndustryStatistic = (timeSpan: string): Promise<Result<any>> => {
  return $http.get({
    url: `${BASE_URL}/hangduanSendNumber`,
    data: { timeSpan },
  });
};

/**靶向发送量统计*/
export const homeTargetStatistic = (timeSpan: string): Promise<Result<any>> => {
  return $http.get({
    url: `${BASE_URL}/fenceSendNumber`,
    data: { timeSpan },
  });
};

/**智能外呼呼叫时长统计*/
export const homeOutboundStatistic = (timeSpan: string): Promise<Result<any>> => {
  return $http.get({
    url: `${BASE_URL}/intelligencecallCallDuration`,
    data: { timeSpan },
  });
};

/** 统计数据 */
export const homeAllStatistic = (data): Promise<Result<any>> => {
  return $http.get({
    url: `${BASE_URL}/data`,
    data,
  });
};

/** 费用分布 */
export const homeAllCost = (timeSpan: string): Promise<Result<any>> => {
  return $http.get({
    url: `${BASE_URL}/costDistribution`,
    data: { timeSpan },
  });
};

/** 发送量排名 */
export const homeSendRank = (timeSpan: string): Promise<Result<any>> => {
  return $http.get({
    url: `${BASE_URL}/smsSendNumberRank`,
    data: { timeSpan },
  });
};

/** 智能外呼排名 */
export const homeOutboundRank = (timeSpan: string): Promise<Result<any>> => {
  return $http.get({
    url: `${BASE_URL}/intelligencecallCallRank`,
    data: { timeSpan },
  });
};

/** 费用排名 */
export const homeCostRank = (timeSpan: string): Promise<Result<any>> => {
  return $http.get({
    url: `${BASE_URL}/costRank`,
    data: { timeSpan },
  });
};

/** 数据统计-根据局办统计 */
export const homeStatisticByBureau = (data: any): Promise<Result<any>> => {
  return $http.get({
    url: `${BASE_URL}/dataByjuban`,
    data,
  });
};
